package com.tanhua.sso.config;


import lombok.Getter;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

@Getter
public class AliyunSMSConfig {

    private String regionId;
    private String accessKeyId;
    private String accessKeySecret;
    private String domain;
    private String signName;
    private String templateCode;

    public AliyunSMSConfig() {
        //类加载器加载配置文件
        InputStream resourceAsStream = AliyunSMSConfig.class.getClassLoader().getResourceAsStream("aliyun.properties");
        Properties properties = new Properties();
        try {
            properties.load(resourceAsStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
        regionId = properties.getProperty("aliyun.sms.regionId");
        accessKeyId = properties.getProperty("aliyun.sms.accessKeyId");
        accessKeySecret = properties.getProperty("aliyun.sms.accessKeySecret");
        domain = properties.getProperty("aliyun.sms.domain");
        signName = properties.getProperty("aliyun.sms.signName");
        templateCode = properties.getProperty("aliyun.sms.templateCode");

    }

}